package com.itheima.ydd.controller;

import com.itheima.ydd.common.R;
import com.itheima.ydd.service.SysDictService;
import com.itheima.ydd.vo.ProfileVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/index")
@Slf4j
public class SysDictController {
    @Autowired
    private SysDictService sysDictService;

    @PostMapping("/profile")
    public R profile(HttpSession session){
        String sysUserId = (String) session.getAttribute("sysUser");
        log.info("用户id"+sysUserId);
        ProfileVo profileVo = sysDictService.profile(sysUserId);
        return R.success(profileVo);
    }

    @GetMapping("baseInfo")
    public R baseInfo(){
        return null;
    }
}
